﻿Imports System
Imports System.Drawing
Imports System.Windows.Forms

Namespace System.Workflow.ComponentModel.Design
    Public MustInherit Class WorkflowDesignerMessageFilter
        Implements IDisposable, IWorkflowDesignerMessageSink
        ' Methods
        Protected Sub New()
        End Sub

        Public Sub Dispose()
            Me.Dispose(True)
            GC.SuppressFinalize(Me)
        End Sub

        Protected Overridable Sub Dispose(ByVal disposing As Boolean)
        End Sub

        Protected Overrides Sub Finalize()
            Try 
                Me.Dispose(False)
            Finally
                MyBase.Finalize
            End Try
        End Sub

        Friend Function GetService(ByVal serviceType As Type) As Object
            Dim service As Object = Nothing
            If (Not Me.parentView Is Nothing) Then
                service = DirectCast(Me.parentView, IServiceProvider).GetService(serviceType)
            End If
            Return service
        End Function

        Protected Overridable Sub Initialize(ByVal parentView As WorkflowView)
            Me.parentView = parentView
        End Sub

        Protected Overridable Function OnDragDrop(ByVal eventArgs As DragEventArgs) As Boolean
            Return False
        End Function

        Protected Overridable Function OnDragEnter(ByVal eventArgs As DragEventArgs) As Boolean
            Return False
        End Function

        Protected Overridable Function OnDragLeave() As Boolean
            Return False
        End Function

        Protected Overridable Function OnDragOver(ByVal eventArgs As DragEventArgs) As Boolean
            Return False
        End Function

        Protected Overridable Function OnGiveFeedback(ByVal eventArgs As GiveFeedbackEventArgs) As Boolean
            Return False
        End Function

        Protected Overridable Function OnKeyDown(ByVal eventArgs As KeyEventArgs) As Boolean
            Return False
        End Function

        Protected Overridable Function OnKeyUp(ByVal eventArgs As KeyEventArgs) As Boolean
            Return False
        End Function

        Protected Overridable Sub OnLayout(ByVal eventArgs As LayoutEventArgs)
        End Sub

        Protected Overridable Function OnMouseCaptureChanged() As Boolean
            Return False
        End Function

        Protected Overridable Function OnMouseDoubleClick(ByVal eventArgs As MouseEventArgs) As Boolean
            Return False
        End Function

        Protected Overridable Function OnMouseDown(ByVal eventArgs As MouseEventArgs) As Boolean
            Return False
        End Function

        Protected Overridable Function OnMouseEnter(ByVal eventArgs As MouseEventArgs) As Boolean
            Return False
        End Function

        Protected Overridable Function OnMouseHover(ByVal eventArgs As MouseEventArgs) As Boolean
            Return False
        End Function

        Protected Overridable Function OnMouseLeave() As Boolean
            Return False
        End Function

        Protected Overridable Function OnMouseMove(ByVal eventArgs As MouseEventArgs) As Boolean
            Return False
        End Function

        Protected Overridable Function OnMouseUp(ByVal eventArgs As MouseEventArgs) As Boolean
            Return False
        End Function

        Protected Overridable Function OnMouseWheel(ByVal eventArgs As MouseEventArgs) As Boolean
            Return False
        End Function

        Protected Overridable Function OnPaint(ByVal eventArgs As PaintEventArgs, ByVal viewPort As Rectangle, ByVal ambientTheme As AmbientTheme) As Boolean
            Return False
        End Function

        Protected Overridable Function OnPaintWorkflowAdornments(ByVal eventArgs As PaintEventArgs, ByVal viewPort As Rectangle, ByVal ambientTheme As AmbientTheme) As Boolean
            Return False
        End Function

        Protected Overridable Function OnQueryContinueDrag(ByVal eventArgs As QueryContinueDragEventArgs) As Boolean
            Return False
        End Function

        Protected Overridable Function OnScroll(ByVal sender As ScrollBar, ByVal value As Integer) As Boolean
            Return False
        End Function

        Protected Overridable Function OnShowContextMenu(ByVal screenMenuPoint As Point) As Boolean
            Return False
        End Function

        Protected Overridable Sub OnThemeChange()
        End Sub

        Protected Overridable Function ProcessMessage(ByVal message As Message) As Boolean
            Return False
        End Function

        Friend Sub SetParentView(ByVal parentView As WorkflowView)
            Me.Initialize(parentView)
        End Sub

        Private Sub System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnBeginResizing(ByVal sizingEdge As DesignerEdges) Implements IWorkflowDesignerMessageSink.OnBeginResizing
        End Sub

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnDragDrop(ByVal eventArgs As DragEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnDragDrop
            Dim flag As Boolean = False
            Try 
                flag = Me.OnDragDrop(eventArgs)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnDragEnter(ByVal eventArgs As DragEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnDragEnter
            Dim flag As Boolean = False
            Try 
                flag = Me.OnDragEnter(eventArgs)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnDragLeave() As Boolean Implements IWorkflowDesignerMessageSink.OnDragLeave
            Dim flag As Boolean = False
            Try 
                flag = Me.OnDragLeave
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnDragOver(ByVal eventArgs As DragEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnDragOver
            Dim flag As Boolean = False
            Try 
                flag = Me.OnDragOver(eventArgs)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Sub System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnEndResizing() Implements IWorkflowDesignerMessageSink.OnEndResizing
        End Sub

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnGiveFeedback(ByVal eventArgs As GiveFeedbackEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnGiveFeedback
            Dim flag As Boolean = False
            Try 
                flag = Me.OnGiveFeedback(eventArgs)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnKeyDown(ByVal eventArgs As KeyEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnKeyDown
            Dim flag As Boolean = False
            Try 
                flag = Me.OnKeyDown(eventArgs)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnKeyUp(ByVal eventArgs As KeyEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnKeyUp
            Dim flag As Boolean = False
            Try 
                flag = Me.OnKeyUp(eventArgs)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Sub System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnLayout(ByVal layoutEventArgs As LayoutEventArgs) Implements IWorkflowDesignerMessageSink.OnLayout
            Try 
                Me.OnLayout(layoutEventArgs)
            Catch obj1 As Object
            End Try
        End Sub

        Private Sub System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnLayoutPosition(ByVal graphics As Graphics) Implements IWorkflowDesignerMessageSink.OnLayoutPosition
        End Sub

        Private Sub System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnLayoutSize(ByVal graphics As Graphics) Implements IWorkflowDesignerMessageSink.OnLayoutSize
        End Sub

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnMouseCaptureChanged() As Boolean Implements IWorkflowDesignerMessageSink.OnMouseCaptureChanged
            Dim flag As Boolean = False
            Try 
                flag = Me.OnMouseCaptureChanged
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnMouseDoubleClick(ByVal eventArgs As MouseEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnMouseDoubleClick
            Dim flag As Boolean = False
            Try 
                flag = Me.OnMouseDoubleClick(eventArgs)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnMouseDown(ByVal eventArgs As MouseEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnMouseDown
            Dim flag As Boolean = False
            Try 
                flag = Me.OnMouseDown(eventArgs)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnMouseDragBegin(ByVal initialPoint As Point, ByVal eventArgs As MouseEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnMouseDragBegin
            Return False
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnMouseDragEnd() As Boolean Implements IWorkflowDesignerMessageSink.OnMouseDragEnd
            Return False
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnMouseDragMove(ByVal eventArgs As MouseEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnMouseDragMove
            Return False
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnMouseEnter(ByVal eventArgs As MouseEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnMouseEnter
            Dim flag As Boolean = False
            Try 
                flag = Me.OnMouseEnter(eventArgs)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnMouseHover(ByVal eventArgs As MouseEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnMouseHover
            Dim flag As Boolean = False
            Try 
                flag = Me.OnMouseHover(eventArgs)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnMouseLeave() As Boolean Implements IWorkflowDesignerMessageSink.OnMouseLeave
            Dim flag As Boolean = False
            Try 
                flag = Me.OnMouseLeave
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnMouseMove(ByVal eventArgs As MouseEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnMouseMove
            Dim flag As Boolean = False
            Try 
                flag = Me.OnMouseMove(eventArgs)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnMouseUp(ByVal eventArgs As MouseEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnMouseUp
            Dim flag As Boolean = False
            Try 
                flag = Me.OnMouseUp(eventArgs)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnMouseWheel(ByVal eventArgs As MouseEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnMouseWheel
            Dim flag As Boolean = False
            Try 
                flag = Me.OnMouseWheel(eventArgs)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnPaint(ByVal eventArgs As PaintEventArgs, ByVal viewPort As Rectangle) As Boolean Implements IWorkflowDesignerMessageSink.OnPaint
            Dim flag As Boolean = False
            Try 
                flag = Me.OnPaint(eventArgs, viewPort, WorkflowTheme.CurrentTheme.AmbientTheme)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnPaintWorkflowAdornments(ByVal eventArgs As PaintEventArgs, ByVal viewPort As Rectangle) As Boolean Implements IWorkflowDesignerMessageSink.OnPaintWorkflowAdornments
            Dim flag As Boolean = False
            Try 
                flag = Me.OnPaintWorkflowAdornments(eventArgs, viewPort, WorkflowTheme.CurrentTheme.AmbientTheme)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnQueryContinueDrag(ByVal eventArgs As QueryContinueDragEventArgs) As Boolean Implements IWorkflowDesignerMessageSink.OnQueryContinueDrag
            Dim flag As Boolean = False
            Try 
                flag = Me.OnQueryContinueDrag(eventArgs)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Sub System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnResizing(ByVal sizingEdge As DesignerEdges, ByVal bounds As Rectangle) Implements IWorkflowDesignerMessageSink.OnResizing
        End Sub

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnScroll(ByVal sender As ScrollBar, ByVal value As Integer) As Boolean Implements IWorkflowDesignerMessageSink.OnScroll
            Dim flag As Boolean = False
            Try 
                flag = Me.OnScroll(sender, value)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnShowContextMenu(ByVal screenMenuPoint As Point) As Boolean Implements IWorkflowDesignerMessageSink.OnShowContextMenu
            Dim flag As Boolean = False
            Try 
                flag = Me.OnShowContextMenu(screenMenuPoint)
            Catch obj1 As Object
            End Try
            Return flag
        End Function

        Private Sub System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.OnThemeChange() Implements IWorkflowDesignerMessageSink.OnThemeChange
            Try 
                Me.OnThemeChange
            Catch obj1 As Object
            End Try
        End Sub

        Private Function System.Workflow.ComponentModel.Design.IWorkflowDesignerMessageSink.ProcessMessage(ByVal message As Message) As Boolean Implements IWorkflowDesignerMessageSink.ProcessMessage
            Dim flag As Boolean = False
            Try 
                flag = Me.ProcessMessage(message)
            Catch obj1 As Object
            End Try
            Return flag
        End Function


        ' Properties
        Protected ReadOnly Property MessageHitTestContext As HitTestInfo
            Get
                Dim messageHitTestContext As HitTestInfo = Me.ParentView.MessageHitTestContext
                If (messageHitTestContext Is Nothing) Then
                    messageHitTestContext = HitTestInfo.Nowhere
                End If
                Return messageHitTestContext
            End Get
        End Property

        Protected ReadOnly Property ParentView As WorkflowView
            Get
                Return Me.parentView
            End Get
        End Property


        ' Fields
        Private parentView As WorkflowView
    End Class
End Namespace

